import {action, observable} from 'mobx'
import {FormFieldStore} from "../Form";

export class CheckBoxStore extends FormFieldStore {

    @observable checked = false

    constructor(props) {
        super(props)
        const {checked, value} = props
        this.checked = !!checked
        this.value = value
        this.checkable = true
    }

    @action toggle() {
        this.checked = !this.checked
    }
}

